package 面向对象高级.内部类.局部内部类;

import org.junit.runner.Runner;

/**public class TestLocalInner {
    public static void main(String[] args) {
        Outer.outMethod();
        System.out.println("---------");

        Outer out = new Outer();
        out.outTest();
        System.out.println("---------");

        Runner runner = Outer.getRunner();
        runner.runner();
    }
}

class Outer {
    public static void outMethod() {
        System.out.println("Outer.outMethod");
        final String c = "局部变量c";
        class Inner {
            public void inMethod1() {
                System.out.println("Inner.inMethod1");
                System.out.println(c);
            }
        }
        //访问局部内部类
        Inner inner = new Inner();
        inner.inMethod1();
    }

    public void outTest() {
        class Inner {
            public void inMethod1() {
                System.out.println("Inner.inMethod1");
            }
        }
        Inner inner = new Inner();
        inner.inMethod1();
    }
}

    public static Runner getRunner(){
        class LocalRunner implements Runner{
            @Override
            public void runner(){
                System.out.println("LocalRunner.run");
            }
        }
        return new LocalRunner();
    }
}

interface Runner{
    void runner();
}*/